/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package uimigration.Plateform.impl;

import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.impl.EPackageImpl;

import uimigration.Interactions.InteractionsPackage;
import uimigration.Interactions.impl.InteractionsPackageImpl;
import uimigration.Plateform.Device;
import uimigration.Plateform.Plateform;
import uimigration.Plateform.PlateformFactory;
import uimigration.Plateform.PlateformPackage;
import uimigration.Plateform.UserInteractions;
import uimigration.UIModel.UIModelPackage;
import uimigration.UIModel.impl.UIModelPackageImpl;
import uimigration.WidgetsModel.WidgetsModelPackage;
import uimigration.WidgetsModel.impl.WidgetsModelPackageImpl;
import uimigration.mappingmodel.MappingmodelPackage;
import uimigration.mappingmodel.impl.MappingmodelPackageImpl;
import uimigration.uipositionning.UipositionningPackage;
import uimigration.uipositionning.impl.UipositionningPackageImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Package</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class PlateformPackageImpl extends EPackageImpl implements
		PlateformPackage {
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass plateformEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass deviceEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass userInteractionsEClass = null;

	/**
	 * Creates an instance of the model <b>Package</b>, registered with
	 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
	 * package URI value.
	 * <p>Note: the correct way to create the package is via the static
	 * factory method {@link #init init()}, which also performs
	 * initialization of the package, or returns the registered package,
	 * if one already exists.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see org.eclipse.emf.ecore.EPackage.Registry
	 * @see uimigration.Plateform.PlateformPackage#eNS_URI
	 * @see #init()
	 * @generated
	 */
	private PlateformPackageImpl() {
		super(eNS_URI, PlateformFactory.eINSTANCE);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private static boolean isInited = false;

	/**
	 * Creates, registers, and initializes the <b>Package</b> for this
	 * model, and for any others upon which it depends.  Simple
	 * dependencies are satisfied by calling this method on all
	 * dependent packages before doing anything else.  This method drives
	 * initialization for interdependent packages directly, in parallel
	 * with this package, itself.
	 * <p>Of this package and its interdependencies, all packages which
	 * have not yet been registered by their URI values are first created
	 * and registered.  The packages are then initialized in two steps:
	 * meta-model objects for all of the packages are created before any
	 * are initialized, since one package's meta-model objects may refer to
	 * those of another.
	 * <p>Invocation of this method will not affect any packages that have
	 * already been initialized.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #eNS_URI
	 * @see #createPackageContents()
	 * @see #initializePackageContents()
	 * @generated
	 */
	public static PlateformPackage init() {
		if (isInited)
			return (PlateformPackage) EPackage.Registry.INSTANCE
					.getEPackage(PlateformPackage.eNS_URI);

		// Obtain or create and register package
		PlateformPackageImpl thePlateformPackage = (PlateformPackageImpl) (EPackage.Registry.INSTANCE
				.getEPackage(eNS_URI) instanceof PlateformPackageImpl ? EPackage.Registry.INSTANCE
				.getEPackage(eNS_URI)
				: new PlateformPackageImpl());

		isInited = true;

		// Obtain or create and register interdependencies
		UIModelPackageImpl theUIModelPackage = (UIModelPackageImpl) (EPackage.Registry.INSTANCE
				.getEPackage(UIModelPackage.eNS_URI) instanceof UIModelPackageImpl ? EPackage.Registry.INSTANCE
				.getEPackage(UIModelPackage.eNS_URI)
				: UIModelPackage.eINSTANCE);
		InteractionsPackageImpl theInteractionsPackage = (InteractionsPackageImpl) (EPackage.Registry.INSTANCE
				.getEPackage(InteractionsPackage.eNS_URI) instanceof InteractionsPackageImpl ? EPackage.Registry.INSTANCE
				.getEPackage(InteractionsPackage.eNS_URI)
				: InteractionsPackage.eINSTANCE);
		WidgetsModelPackageImpl theWidgetsModelPackage = (WidgetsModelPackageImpl) (EPackage.Registry.INSTANCE
				.getEPackage(WidgetsModelPackage.eNS_URI) instanceof WidgetsModelPackageImpl ? EPackage.Registry.INSTANCE
				.getEPackage(WidgetsModelPackage.eNS_URI)
				: WidgetsModelPackage.eINSTANCE);
		UipositionningPackageImpl theUipositionningPackage = (UipositionningPackageImpl) (EPackage.Registry.INSTANCE
				.getEPackage(UipositionningPackage.eNS_URI) instanceof UipositionningPackageImpl ? EPackage.Registry.INSTANCE
				.getEPackage(UipositionningPackage.eNS_URI)
				: UipositionningPackage.eINSTANCE);
		MappingmodelPackageImpl theMappingmodelPackage = (MappingmodelPackageImpl) (EPackage.Registry.INSTANCE
				.getEPackage(MappingmodelPackage.eNS_URI) instanceof MappingmodelPackageImpl ? EPackage.Registry.INSTANCE
				.getEPackage(MappingmodelPackage.eNS_URI)
				: MappingmodelPackage.eINSTANCE);

		// Create package meta-data objects
		thePlateformPackage.createPackageContents();
		theUIModelPackage.createPackageContents();
		theInteractionsPackage.createPackageContents();
		theWidgetsModelPackage.createPackageContents();
		theUipositionningPackage.createPackageContents();
		theMappingmodelPackage.createPackageContents();

		// Initialize created meta-data
		thePlateformPackage.initializePackageContents();
		theUIModelPackage.initializePackageContents();
		theInteractionsPackage.initializePackageContents();
		theWidgetsModelPackage.initializePackageContents();
		theUipositionningPackage.initializePackageContents();
		theMappingmodelPackage.initializePackageContents();

		// Mark meta-data to indicate it can't be changed
		thePlateformPackage.freeze();

		return thePlateformPackage;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getPlateform() {
		return plateformEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getPlateform_Name() {
		return (EAttribute) plateformEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getPlateform_Contains() {
		return (EReference) plateformEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getDevice() {
		return deviceEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getDevice_IdDevice() {
		return (EAttribute) deviceEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getDevice_Name() {
		return (EAttribute) deviceEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getDevice_Has() {
		return (EReference) deviceEClass.getEStructuralFeatures().get(2);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getUserInteractions() {
		return userInteractionsEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getUserInteractions_ActionName() {
		return (EAttribute) userInteractionsEClass.getEStructuralFeatures()
				.get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getUserInteractions_Actions() {
		return (EReference) userInteractionsEClass.getEStructuralFeatures()
				.get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getUserInteractions_ClassName() {
		return (EAttribute) userInteractionsEClass.getEStructuralFeatures()
				.get(2);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public PlateformFactory getPlateformFactory() {
		return (PlateformFactory) getEFactoryInstance();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isCreated = false;

	/**
	 * Creates the meta-model objects for the package.  This method is
	 * guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void createPackageContents() {
		if (isCreated)
			return;
		isCreated = true;

		// Create classes and their features
		plateformEClass = createEClass(PLATEFORM);
		createEAttribute(plateformEClass, PLATEFORM__NAME);
		createEReference(plateformEClass, PLATEFORM__CONTAINS);

		deviceEClass = createEClass(DEVICE);
		createEAttribute(deviceEClass, DEVICE__ID_DEVICE);
		createEAttribute(deviceEClass, DEVICE__NAME);
		createEReference(deviceEClass, DEVICE__HAS);

		userInteractionsEClass = createEClass(USER_INTERACTIONS);
		createEAttribute(userInteractionsEClass, USER_INTERACTIONS__ACTION_NAME);
		createEReference(userInteractionsEClass, USER_INTERACTIONS__ACTIONS);
		createEAttribute(userInteractionsEClass, USER_INTERACTIONS__CLASS_NAME);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isInitialized = false;

	/**
	 * Complete the initialization of the package and its meta-model.  This
	 * method is guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void initializePackageContents() {
		if (isInitialized)
			return;
		isInitialized = true;

		// Initialize package
		setName(eNAME);
		setNsPrefix(eNS_PREFIX);
		setNsURI(eNS_URI);

		// Obtain other dependent packages
		InteractionsPackage theInteractionsPackage = (InteractionsPackage) EPackage.Registry.INSTANCE
				.getEPackage(InteractionsPackage.eNS_URI);

		// Add supertypes to classes

		// Initialize classes and features; add operations and parameters
		initEClass(plateformEClass, Plateform.class, "Plateform", !IS_ABSTRACT,
				!IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getPlateform_Name(), ecorePackage.getEString(), "name",
				null, 0, 1, Plateform.class, !IS_TRANSIENT, !IS_VOLATILE,
				IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED,
				IS_ORDERED);
		initEReference(getPlateform_Contains(), this.getDevice(), null,
				"contains", null, 0, -1, Plateform.class, !IS_TRANSIENT,
				!IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES,
				!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		addEOperation(plateformEClass, null, "addDevice");

		addEOperation(plateformEClass, null, "removeDevice");

		initEClass(deviceEClass, Device.class, "Device", !IS_ABSTRACT,
				!IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getDevice_IdDevice(), ecorePackage.getEInt(),
				"idDevice", null, 0, 1, Device.class, !IS_TRANSIENT,
				!IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
				!IS_DERIVED, IS_ORDERED);
		initEAttribute(getDevice_Name(), ecorePackage.getEString(), "name",
				null, 0, 1, Device.class, !IS_TRANSIENT, !IS_VOLATILE,
				IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED,
				IS_ORDERED);
		initEReference(getDevice_Has(), this.getUserInteractions(), null,
				"has", null, 0, -1, Device.class, !IS_TRANSIENT, !IS_VOLATILE,
				IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES,
				!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(userInteractionsEClass, UserInteractions.class,
				"UserInteractions", !IS_ABSTRACT, !IS_INTERFACE,
				IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getUserInteractions_ActionName(), ecorePackage
				.getEString(), "actionName", null, 0, 1,
				UserInteractions.class, !IS_TRANSIENT, !IS_VOLATILE,
				IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED,
				IS_ORDERED);
		initEReference(getUserInteractions_Actions(), theInteractionsPackage
				.getAction(), null, "actions", null, 0, -1,
				UserInteractions.class, !IS_TRANSIENT, !IS_VOLATILE,
				IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES,
				!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getUserInteractions_ClassName(), ecorePackage
				.getEString(), "className", null, 0, 1, UserInteractions.class,
				!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE,
				!IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		// Create resource
		createResource(eNS_URI);
	}

} //PlateformPackageImpl
